#include <stdio.h>

void test_one()
{
  /*40064c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400650:	910003fd 	mov	x29, sp
  400654:	52800020 	mov	w0, #0x1                   	// #1
  400658:	b90017a0 	str	w0, [x29, #20]*/
	int a = 1;

  /*40065c:	910053a0 	add	x0, x29, #0x14	// x0 = x29+20
  400660:	f9000fa0 	str	x0, [x29, #24]	*/
	char *b = &a;

  /*400664:	f9400fa0 	ldr	x0, [x29, #24]
  400668:	39400000 	ldrb	w0, [x0]
  40066c:	7100041f 	cmp	w0, #0x1*/
	if (*b == 1) {
		printf("asdf\n");
	}
	else {
		printf("dddd\n");
	}

  /*400670:	540000a1 	b.ne	400684 <test_one+0x38>  // b.any
  400674:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400678:	91246000 	add	x0, x0, #0x918
  40067c:	97ffffad 	bl	400530 <puts@plt>
  400680:	14000004 	b	400690 <test_one+0x44>
  400684:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400688:	9124a000 	add	x0, x0, #0x928
  40068c:	97ffffa9 	bl	400530 <puts@plt>
  400690:	d503201f 	nop
  400694:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400698:	d65f03c0 	ret*/
}

int checkCPU()
{
  /*40069c:	d10043ff 	sub	sp, sp, #0x10*/
	union ua
	{
		int ab;
		char ac;
	}a;

  /*4006a0:	52800020 	mov	w0, #0x1                   	// #1
  4006a4:	b9000be0 	str	w0, [sp, #8]*/
	a.ab = 0x1;

  /*4006a8:	394023e0 	ldrb	w0, [sp, #8]
  4006ac:	7100041f 	cmp	w0, #0x1
  4006b0:	1a9f17e0 	cset	w0, eq  // eq = none
  4006b4:	12001c00 	and	w0, w0, #0xff
  4006b8:	910043ff 	add	sp, sp, #0x10
  4006bc:	d65f03c0 	ret*/
  return (a.ac == 1);
}

int test_two()
{
  /*4006c0:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  4006c4:	910003fd 	mov	x29, sp
  4006c8:	d2800020 	mov	x0, #0x1                   	// #1
  4006cc:	f9000fa0 	str	x0, [x29, #24]*/
	int *a = 0x1;

  /*4006d0:	f9400fa0 	ldr	x0, [x29, #24]
  4006d4:	91003000 	add	x0, x0, #0xc
  4006d8:	f100041f 	cmp	x0, #0x1	  
  4006dc:	540000a1 	b.ne	4006f0 <test_two+0x30>  // b.any
  4006e0:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006e4:	9124e000 	add	x0, x0, #0x938
  4006e8:	97ffff92 	bl	400530 <puts@plt>
  4006ec:	14000004 	b	4006fc <test_two+0x3c>
  4006f0:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006f4:	91250000 	add	x0, x0, #0x940
  4006f8:	97ffff8e 	bl	400530 <puts@plt>*/
	if (&a[3] == 1) {
		printf("asdf\n");
	}
	else {
		printf("dddd\n");
	}

  /*4006fc:	f9400fa0 	ldr	x0, [x29, #24]
  400700:	91001001 	add	x1, x0, #0x4		// x1=a+1
  400704:	f9400fa0 	ldr	x0, [x29, #24]
  400708:	91002002 	add	x2, x0, #0x8		// a+2
  40070c:	f9400fa0 	ldr	x0, [x29, #24]
  400710:	91003003 	add	x3, x0, #0xc		// a+3
  400714:	f9400fa0 	ldr	x0, [x29, #24]
  400718:	91004004 	add	x4, x0, #0x10		// a+4
  40071c:	f9400fa0 	ldr	x0, [x29, #24]
  400720:	91005005 	add	x5, x0, #0x14		// a+5
  400724:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400728:	91252000 	add	x0, x0, #0x948
  40072c:	aa0503e6 	mov	x6, x5
  400730:	aa0403e5 	mov	x5, x4
  400734:	aa0303e4 	mov	x4, x3
  400738:	aa0203e3 	mov	x3, x2
  40073c:	aa0103e2 	mov	x2, x1
  400740:	f9400fa1 	ldr	x1, [x29, #24]
  400744:	97ffff7f 	bl	400540 <printf@plt>*/
	printf("%x %x %x %x %x %x\n", a, a+1, a+2, a+3, a+4, a+5);
  
  /*400748:	d503201f 	nop
  40074c:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400750:	d65f03c0 	ret*/
}

void test_thr()
{
  /*400754:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400758:	910003fd 	mov	x29, sp*/
	union ua
	{
		int ab;
		short ac;
	}a;

  /*40075c:	528acf00 	mov	w0, #0x5678                	// #22136
  400760:	72a24680 	movk	w0, #0x1234, lsl #16
  400764:	b9001ba0 	str	w0, [x29, #24] */
	a.ab = 0x12345678;

  /*400768:	79c033a1 	ldrsh	w1, [x29, #24]
  40076c:	52824680 	mov	w0, #0x1234                	// #4660
  400770:	6b00003f 	cmp	w1, w0
  400774:	54000081 	b.ne	400784 <test_thr+0x30>  // b.any
  400778:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  40077c:	9124e000 	add	x0, x0, #0x938
  400780:	97ffff6c 	bl	400530 <puts@plt>
  400784:	79c033a1 	ldrsh	w1, [x29, #24]
  400788:	528acf00 	mov	w0, #0x5678                	// #22136
  40078c:	6b00003f 	cmp	w1, w0
  400790:	54000081 	b.ne	4007a0 <test_thr+0x4c>  // b.any
  400794:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400798:	91250000 	add	x0, x0, #0x940
  40079c:	97ffff65 	bl	400530 <puts@plt>*/
	if (a.ac == 0x1234) {
		printf("asdf\n");
	}
	
	if (a.ac == 0x5678) {
		printf("dddd\n");
	}

  /*4007a0:	d503201f 	nop
  4007a4:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4007a8:	d65f03c0 	ret*/
}

void test_four()
{
  /*4007ac:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  4007b0:	910003fd 	mov	x29, sp
  4007b4:	910053a0 	add	x0, x29, #0x14	// x0 = x29+20*/
	int a;

  /*4007b8:	f9000fa0 	str	x0, [x29, #24]	// [x29+24] = x29+20 */
	char *p = &a;

  /*4007bc:	b90017bf 	str	wzr, [x29, #20]*/
	a = 0;

  /*4007c0:	f9400fa0 	ldr	x0, [x29, #24]
  4007c4:	12800001 	mov	w1, #0xffffffff            	// #-1
  4007c8:	39000001 	strb	w1, [x0] */
	*p = 0xffffffff;

  /*4007cc:	b94017a0 	ldr	w0, [x29, #20]
  4007d0:	7103fc1f 	cmp	w0, #0xff
  4007d4:	540000a1 	b.ne	4007e8 <test_four+0x3c>  // b.any
  4007d8:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4007dc:	9125a000 	add	x0, x0, #0x968
  4007e0:	97ffff54 	bl	400530 <puts@plt>
  4007e4:	14000004 	b	4007f4 <test_four+0x48>
  4007e8:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4007ec:	91262000 	add	x0, x0, #0x988
  4007f0:	97ffff50 	bl	400530 <puts@plt>
  4007f4:	52800000 	mov	w0, #0x0                   	// #0
  4007f8:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4007fc:	d65f03c0 	ret*/
	if (a == 0xff) {
		printf("asdf\n");
	}
	else {
		printf("ssss\n");
	}
}

int main()
{
  /*400800:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400804:	910003fd 	mov	x29, sp
  400808:	12800000 	mov	w0, #0xffffffff            	// #-1
  40080c:	b9001fa0 	str	w0, [x29, #28]*/
	int a = 0xffffffff;

  /*400810:	97ffff8f 	bl	40064c <test_one>*/
	test_one();

  /*400814:	97ffffa2 	bl	40069c <checkCPU>
  400818:	b9001fa0 	str	w0, [x29, #28]*/
	a = checkCPU();

  /*40081c:	b9401fa0 	ldr	w0, [x29, #28]
  400820:	7100041f 	cmp	w0, #0x1
  400824:	540000a1 	b.ne	400838 <main+0x38>  // b.any
  400828:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  40082c:	9126a000 	add	x0, x0, #0x9a8
  400830:	97ffff40 	bl	400530 <puts@plt>
  400834:	14000007 	b	400850 <main+0x50>
  400838:	b9401fa0 	ldr	w0, [x29, #28]
  40083c:	7100001f 	cmp	w0, #0x0
  400840:	54000081 	b.ne	400850 <main+0x50>  // b.any
  400844:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400848:	9126e000 	add	x0, x0, #0x9b8
  40084c:	97ffff39 	bl	400530 <puts@plt> */
	if (a == 1) {
		printf("asdf\n");
	}
	else if (a == 0) {
		printf("dddd\n");
	}

  /*400850:	97ffff9c 	bl	4006c0 <test_two>*/
	test_two();

  /*400854:	97ffffc0 	bl	400754 <test_thr>*/
	test_thr();

  /*400858:	97ffffd5 	bl	4007ac <test_four>*/
	test_four();

  /*40085c:	52800000 	mov	w0, #0x0                   	// #0
  400860:	a8c27bfd 	ldp	x29, x30, [sp], #32
  400864:	d65f03c0 	ret*/
  return 0;
}
